import request from '@/utils/request';

export function fetchDepartmentList() {
    return request({
        url: '/dept/allDept',
        method: 'get',
    });
}

export function fetchDeptList(deptName, page, limit) {
    return request({
        url: '/dept/list',
        method: 'get',
        params: {
            deptName: deptName,
            page: page,
            limit: limit
        }
    });
}

export function addDept(dept) {
    return request({
        url: '/dept/add',
        method: 'post',
        data: dept
    });
}

export function renewDept(dept) {
    return request({
        url: '/dept/renew',
        method: 'post',
        data: dept
    });
}

export function removeDept(deptId) {
    return request({
        url: '/dept/remove',
        method: 'post',
        params: {
            deptId: deptId
        }
    });
}
